Skip to content

reorganize tests - #60

Merged
christophsax merged 1 commit into
mainfrom
test-reorga
Nov 3, 2025
Merged

reorganize tests#60
christophsax merged 1 commit into
mainfrom
test-reorga

Conversation

@christophsax

@christophsax christophsax commented Nov 3, 2025

Copy link
Copy Markdown
Member

Note

Replaces the old CI-only monolithic tests with a structured testthat suite using inline fixtures, adds generator scripts, and introduces comprehensive method and regression tests with skip_on_cran.

  • Tests:
    • Replace tests/test-all.R with focused testthat files: test-aggregation.R, test-conversion-types.R, test-methods-chow-lin.R, test-methods-denton.R, test-methods-other.R, test-numerical-regression.R (all use skip_on_cran() where heavy).
    • Add shared fixtures in tests/testthat/helper-fixtures.R (inline imports.m plus reference lists reference_y2q, reference_q2m).
    • Remove legacy tests tests/testthat/test_output.R and tests/testthat/test_ta.R.
  • Tooling (noinst/):
    • Add noinst/README.md, extract_test_data.R, and generate_test_code.R to generate and maintain inline test data/fixtures from .RData sources.

Written by Cursor Bugbot for commit 3717188. This will update automatically on new commits. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 31

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

td(y ~ 1, method = "chow-lin-minrss-ecotrim", truncated.rho = -1),
NA # NA means we expect no error, or we might expect a specific error
)
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Clarify Chow-Lin Intercept-Only Edge Case Behavior

The test for chow-lin with an intercept-only model (y ~ 1) asserts no error using expect_error(..., NA). The accompanying comment, however, incorrectly suggests ambiguity about this expectation, stating an error might also be valid. This creates a misleading comment and unclear test logic. Clarifying the intended behavior for this edge case is important, as Chow-Lin methods typically require indicator variables.

Fix in Cursor Fix in Web

start = 1975, frequency = 1
)

cat("sales.a matches reconstructed:", all.equal(sales.a, sales_reconstructed), "\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Mismatched Time Range Breaks Dataset Equality Check

The verification step compares the full sales.a dataset with sales_reconstructed. However, sales_reconstructed is a hardcoded subset (1975-2010), while sales.a is the complete dataset. This difference in time periods and length means the all.equal comparison will always fail.

Fix in Cursor Fix in Web

@christophsax
christophsax merged commit ca55475 into main Nov 3, 2025
6 checks passed
@christophsax
christophsax deleted the test-reorga branch November 3, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant